package com.jpcc.vw.onlineRadio.api;


import com.jpcc.vw.onlineRadio.model.bean.AlbumBrowseBean;
import com.jpcc.vw.onlineRadio.model.bean.AlbumBrowseBeanNew;
import com.jpcc.vw.onlineRadio.model.bean.AlbumCategoryBean;
import com.jpcc.vw.onlineRadio.model.bean.AlbumCategoryResultBean;
import com.jpcc.vw.onlineRadio.model.bean.AlbumFavouriteBean;
import com.jpcc.vw.onlineRadio.model.bean.AllSearchResult;
import com.jpcc.vw.onlineRadio.model.bean.BaseBean;
import com.jpcc.vw.onlineRadio.model.bean.BestCollectionBean;
import com.jpcc.vw.onlineRadio.model.bean.BoughtAlbumBean;
import com.jpcc.vw.onlineRadio.model.bean.CPInfoBean;
import com.jpcc.vw.onlineRadio.model.bean.CategoryTagBean;
import com.jpcc.vw.onlineRadio.model.bean.DailyRecommendationBean;
import com.jpcc.vw.onlineRadio.model.bean.ExclusiveRecommendationBean;
import com.jpcc.vw.onlineRadio.model.bean.HotwordsBean;
import com.jpcc.vw.onlineRadio.model.bean.LiveRadioDetailBean;
import com.jpcc.vw.onlineRadio.model.bean.LocalOnlineRadioBean;
import com.jpcc.vw.onlineRadio.model.bean.NewAlbumAndRadiosData;
import com.jpcc.vw.onlineRadio.model.bean.NewRecommendBean;
import com.jpcc.vw.onlineRadio.model.bean.NewSearchAlbumResultBean;
import com.jpcc.vw.onlineRadio.model.bean.OnlineRadioCityBean;
import com.jpcc.vw.onlineRadio.model.bean.OnlineRadioSimpleInfoBean;
import com.jpcc.vw.onlineRadio.model.bean.PaiedAlbumBean;
import com.jpcc.vw.onlineRadio.model.bean.PlayHistoryOnlineBean;
import com.jpcc.vw.onlineRadio.model.bean.PlayInfoBean;
import com.jpcc.vw.onlineRadio.model.bean.PriceTypeInfoBean;
import com.jpcc.vw.onlineRadio.model.bean.RadioDeailBean;
import com.jpcc.vw.onlineRadio.model.bean.SearchAllBean;
import com.jpcc.vw.onlineRadio.model.bean.SearchHistoryResponseBean;
import com.jpcc.vw.onlineRadio.model.bean.SuggestWordsBean;
import com.jpcc.vw.onlineRadio.model.bean.TopListAlbumBean;
import com.jpcc.vw.onlineRadio.model.bean.TopListBean;
import com.jpcc.vw.onlineRadio.model.bean.VIPInfoBean;
import com.jpcc.vw.onlineRadio.model.bean.VIPRecommendationBean;
import com.jpcc.vw.onlineRadio.model.bean.XiMaLaYaOrderBean;

import org.json.JSONObject;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

public interface RadioService {
    @GET("live/cities")
    Observable<OnlineRadioCityBean> GetRadioCode(@Query("latitude") String latitude, @Query("longitude") String longitude);

    @GET("live/getRadiosByCity")
    Observable<OnlineRadioSimpleInfoBean> GetRadiosByCity(@Query("cityCode") int cityCode, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex);

    @GET("recommend/exclusiveRecommendations")
    Observable<ExclusiveRecommendationBean> GetExclusiveRecommendations(@Query("displayCount") int displayCount);

    @GET("recommend/dailyRecommendations")
    Observable<DailyRecommendationBean> GetDailyRecommendations(@Query("displayCount") int displayCount);

    @GET("categories/list")
    Observable<AlbumCategoryBean> GetAlbumCategory();

    @GET("albums/list")
    Observable<AlbumCategoryResultBean> GetAlbumByCategory(@Query("categoryId") long categoryId, @Query("calcDimension") int calcDimension, @Query("pageSize") int count, @Query("pageIndex") int page,@Query("tagName") String tagName);

    @GET("collection/get")
    Observable<AlbumFavouriteBean> GetAlbumRadioFavourite(@Query("userId") long userId,@Query("type")int type);

    @GET("openPay/allPaidAlbums")
    Observable<PaiedAlbumBean> GetAllPaiedAlbum(@Query("userId") long userId, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex);

    @GET("albums/browse")
    Observable<AlbumBrowseBeanNew> GetAlbumBrowse(@Query("albumId") long albumId, @Query("sort") String sort, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex);

    @GET("albums/search")
    Observable<NewSearchAlbumResultBean> SearchAlbums(@Query("q") String q, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex, @Query("containsPaid") boolean containsPaid);


    @GET("live/playingProgram")
    Observable<LiveRadioDetailBean> GetPlayingProgramDetail(@Query("radioId") long radioId);

    @GET("live/schedules")
    Observable<RadioDeailBean> getLiveSchedules(@Query("radioId") long radioId, @Query("weekday") int weekday);

    @GET("playHistory/getByUid")
    Observable<PlayHistoryOnlineBean> getPlayHistory();

    @GET("hotWords/search")
    Observable<HotwordsBean> GetHotWords(@Query("top") int top);

    @GET("suggestWords/search")
    Observable<SuggestWordsBean> GetSearchSuggestWords(@Query("q") String q);

    @GET("localRadios/browse")
    Observable<LocalOnlineRadioBean> BrowseLocalRadios(@Query("latitude") String latitude, @Query("longitude") String longitude,@Query("pageIndex") int pageIndex,@Query("pageSize") int pageSize);


    @GET("localRadios/browse")
    Observable<LocalOnlineRadioBean> BrowseLocalRadios(@Query("pageIndex") int pageIndex,@Query("pageSize") int pageSize);


    @GET("searchHistory/get")
    Observable<SearchHistoryResponseBean> GetSearchHistory();


    @GET("openPay/getPriceInfo")
    Observable<PriceTypeInfoBean> GetPriceInfo(@Query("albumId") long albumId);


    @GET("getCpInfo")
    Observable<CPInfoBean> GetCPInfo();

    @GET("tags/list")
    Observable<CategoryTagBean> GetCategoryTags(@Query("categoryId") long categoryId, @Query("type") int type);

    @POST("openPay/placeOrder")
    Observable<BaseBean> PlaceOrder(@Body JSONObject body);

    @GET("openPay/getBoughtAlbums")
    Observable<BoughtAlbumBean> GetBoughtAlbums();

    @GET("recommendations")
    Observable<NewRecommendBean> GetRecommendation(@Query("kind") String kind, @Query("deviceType") String deviceType, @Query("deviceId") String deviceId, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("openPay/browsePaidAlbumTracks")
    Observable<AlbumBrowseBean> BrowsePaidAlbumTracks(@Query("albumId") long albumId, @Query("sort") String sort, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex,@Query("containsTrackRichIntro") boolean containsTrackRichIntro);

    @GET("ranks")
    Observable<TopListBean> RadioRanks(@Query("kind") String kind, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("ranks/{id}")
//    @FormUrlEncoded
    Observable<TopListAlbumBean> RadioRanksById(@Path("id") String id, @Query("id") int rankId, @Query("pageIndex") int pageIndex, @Query("pageSize") int pageSize);

    @GET("third/user/info")
    Observable<VIPInfoBean> QueryVIPInfo();

    @GET("pay/rankAlbums")
    Observable<BestCollectionBean> BestCollection(@Query("pageIndex")int pageIndex,@Query("pageSize") int pageSize);


    @GET("vip/recommendation")
    Observable<VIPRecommendationBean> VIPRecommendation(@Query("pageIndex")int pageIndex,@Query("pageSize") int pageSize);


    @GET("openPay/getPlayInfo")
    Observable<PlayInfoBean> GetPlayInfo(@Query("trackId") long trackId);

    @GET("searchHistory/clear")
    Observable<BaseBean> ClearSearchHistory();

    @GET("search")
    Observable<NewAlbumAndRadiosData> SearchAll(@Query("q") String q, @Query("pageSize") int pageSize, @Query("pageIndex") int pageIndex, @Query("type") int type);



    @POST("collection/add")
    Observable<BaseBean> AddUserFavourite(@Body RequestBody body);


    @POST("collection/cancel")
    Observable<BaseBean> CancelUserFavourite(@Body RequestBody body);


    @POST("searchHistory/sync")
    Observable<BaseBean> SyncSearchHistory(@Body RequestBody body);

    @POST("playHistory/add")
    Observable<BaseBean> SyncPlayHistory(@Body RequestBody body);
    @POST("playHistory/delete")
    Observable<BaseBean> DeletePlayHistory(@Body RequestBody body);



    @POST("openPay/placeOrder")
    Observable<XiMaLaYaOrderBean> PlaceOrder(@Body RequestBody body);

}
